home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / gnu / fpu881 / src6.zoo / csinh.c < prev    next >
C/C++ Source or Header  |  1991-09-24  |  2KB  |  82 lines

  1. /************************************************************************
  2.  *                                    *
  3.  *                N O T I C E                *
  4.  *                                    *
  5.  *            Copyright Abandoned, 1987, Fred Fish        *
  6.  *                                    *
  7.  *    This previously copyrighted work has been placed into the    *
  8.  *    public domain by the author (Fred Fish) and may be freely used    *
  9.  *    for any purpose, private or commercial.  I would appreciate    *
  10.  *    it, as a courtesy, if this notice is left in all copies and    *
  11.  *    derivative works.  Thank you, and enjoy...            *
  12.  *                                    *
  13.  *    The author makes no warranty of any kind with respect to this    *
  14.  *    product and explicitly disclaims any implied warranties of    *
  15.  *    merchantability or fitness for any particular purpose.        *
  16.  *                                    *
  17.  ************************************************************************
  18.  */
  19.  
  20.  
  21. /*
  22.  *  FUNCTION
  23.  *
  24.  *    csinh   complex double precision hyperbolic sine
  25.  *
  26.  *  KEY WORDS
  27.  *
  28.  *    csinh
  29.  *    machine independent routines
  30.  *    complex functions
  31.  *    math libraries
  32.  *
  33.  *  DESCRIPTION
  34.  *
  35.  *    Computes double precision complex hyperbolic sine of
  36.  *    a double precision complex argument.
  37.  *
  38.  *  USAGE
  39.  *
  40.  *    COMPLEX csinh (z)
  41.  *    COMPLEX z;
  42.  *
  43.  *  PROGRAMMER
  44.  *
  45.  *    Fred Fish
  46.  *    Tempe, Az 85281
  47.  *    (602) 966-8871
  48.  *
  49.  *  INTERNALS
  50.  *
  51.  *    Computes complex hyperbolic sine of z = x + j y from:
  52.  *
  53.  *        csinh(z) = 0.5 * ( cexp(z) - cexp(-z) )
  54.  *
  55.  */
  56.  
  57. #include <stdio.h>
  58. #include <pmluser.h>
  59. #include "pml.h"
  60.  
  61.  
  62. COMPLEX csinh (z)
  63. COMPLEX z;
  64. {
  65.     COMPLEX cexpmz;
  66.     extern COMPLEX cexp ();
  67.  
  68.     ENTER ("csinh");
  69.     DEBUG4 ("csinhin", "arg %le %le", z.real, z.imag);
  70.     cexpmz.real = -z.real;
  71.     cexpmz.imag = -z.imag;
  72.     cexpmz = cexp (cexpmz);
  73.     z = cexp (z);
  74.     z.real -= cexpmz.real;
  75.     z.imag -= cexpmz.imag;
  76.     z.real *= 0.5;
  77.     z.imag *= 0.5;
  78.     DEBUG4 ("csinhout", "result %le %le", z.real, z.imag);
  79.     LEAVE ();
  80.     return (z);
  81. }
  82.